<template>
	<view class="card-box">
		<view class="titles">
			<view class="title">
				{{title}}
				<!-- <img src="https://image.hzwltb69.com/app/imgs/chat/live.gif" alt=""> -->
			</view>
		</view>
		<scroll-view scroll-x="true" style="scoll" >
			<view class="card">
				<view v-for="item in liveList" :key="item.id" @click="onGoLiveList(item)" class="cards">
					<img :src="item.img">
					<view class="ptitle">
						{{item.name}}
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default{
		props:{
			liveList:{
				type: Array,
				default: []
			},
			title:{
				type: String,
				default: '每日直播精选'
			},
		},
		data(){
			return{
			}
		},
		methods:{
			onGoLiveList(e){
				let that = this
				this.$Router.push({
					path: "/pages/goods/detail",
					query: {
						id: e.id
					}
				})
			},
		},
	}
</script>

<style lang="scss">
	.card-box{
		// margin-top: 20rpx;
		margin-bottom: 20rpx;
		padding: 20rpx;
		width: 100%;
		background-color: #fff;
		.titles{
			// border-bottom: 1px solid #ebebeb;
		}
		.title{
			display: flex;
			width: 240rpx;
			height: 50rpx;
			align-items: center;
			border-radius: 15rpx;
			margin-bottom: 10rpx;
			img{
				margin-left: 10rpx;
				width: 40rpx;
				height: 40rpx;
			}
		}
		.card{
			// margin-top: 20rpx;
			display: flex;
			background-color: #fff;
			.cards{
				margin-right: 20rpx;
				flex: 1;
				width: 170rpx;
				height: 220rpx;
				background: #fff;
				display: flex;
				align-items: center;
				flex-direction: column;
				justify-content: center;
				img{
					border-radius: 25rpx;
					width: 170rpx;
					height: 170rpx;
				}
				.ptitle{
					margin-top: 10rpx;
					padding-left: 5rpx;
					width: 170rpx;
					height: 50rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}
			}
		}
	}
</style>